import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-09-27
 * Time: 0:45
 */
//牛牛的快递：
public class CowExpressage {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        double a = in.nextDouble();
        char b = in.next().charAt(0);
        int ret = 0;

        if(a <= 1){
            ret = 20;

        }else {

            //细节处理方法一：ceil函数可以完成向上取整
            // ret = 20 + (int)Math.ceil(a-1);


            //细节处理方法二//超过1部分 - 向下取整结果，大于0，说明可以向上取整
            if(a - (int)(a-1) > 0) {
                ret = 20 + (int)(a-1) + 1;
            }else{
                ret += 20 + (int)(a-1);
            }
        }


        if(b == 'y'){
            ret += 5;
        }

        System.out.println(ret);
    }
}
